﻿// -------------------------------------------------------------------------------------------------
// <copyright file="TVDBSiteMirror.cs" company="HeterogeneousComputing.com">
// Creative Commons Attribution-ShareAlike 3.0 Unported License
// </copyright>
//
// <author>Jock</author>
//
// <date>04/08/2011</date>
//
// <summary>Implements the tvdb site mirror class</summary>
// -------------------------------------------------------------------------------------------------
namespace TheTVDBScraper
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    /// <summary>
    /// Class representing TheTVDB website or one of it's mirrors.
    /// </summary>
    public class TVDBSiteMirror
    {
        #region Private Fields
            /// <summary>
            /// Unique identifier for each Mirror supplied by TheTVDB.
            /// </summary>
            private string mirrorId;

            /// <summary>
            /// Base URL of the path to use for all subsequent lookups
            /// for a given resource based upon the typemasks the mirrors supports.
            /// </summary>
            private string mirrorPath;

            /// <summary>
            /// The typemasks this mirror supports.
            /// </summary>
            private List<TVDBScraper.MirrorsTypeMaskOptionsEnum> typemask = new List<TVDBScraper.MirrorsTypeMaskOptionsEnum>(); 
        #endregion
        #region Properties
            /// <summary>
            /// Gets the unique TheTVDB Mirror Site id.
            /// </summary>
            public string MirrorId
            {
                get
                {
                    return this.mirrorId;
                }

                internal set
                {
                    this.mirrorId = value;
                }
            }

            /// <summary>
            /// Gets TheTVDB Mirror Site base URL.
            /// </summary>
            public string MirrorPath
            {
                get
                {
                    return this.mirrorPath;
                }

                internal set
                {
                    this.mirrorPath = value;
                }
            }

            /// <summary>
            /// Gets TheTVDB Mirror Site supported types mask.
            /// </summary>
            public List<TVDBScraper.MirrorsTypeMaskOptionsEnum> TypeMask
            {
                get
                {
                    return this.typemask;
                }

                internal set
                {
                    this.typemask = value;
                }
            }

            /// <summary>
            /// Gets a value indicating whether the Mirror Site supports XML File information.
            /// </summary>
            public bool SupportsXML
            {
                get
                {
                    bool retVal = false;
                    if (this.typemask.Contains(TVDBScraper.MirrorsTypeMaskOptionsEnum.XML_FILES))
                    {
                        retVal = true;
                    }

                    return retVal;
                }
            }

            /// <summary>
            /// Gets a value indicating whether the Mirror Site supports Banner File information.
            /// </summary>
            public bool SupportsBanner
            {
                get
                {
                    bool retVal = false;
                    if (this.typemask.Contains(TVDBScraper.MirrorsTypeMaskOptionsEnum.BANNER_FILES))
                    {
                        retVal = true;
                    }

                    return retVal;
                }
            }

            /// <summary>
            /// Gets a value indicating whether  the Mirror Site supports ZIP File information.
            /// </summary>
            public bool SupportsZIP
            {
                get
                {
                    bool retVal = false;
                    if (this.typemask.Contains(TVDBScraper.MirrorsTypeMaskOptionsEnum.ZIP_FILES))
                    {
                        retVal = true;
                    }

                    return retVal;
                }
            }
        #endregion
    }
}

/// -------------------------------------------------------------------------------------------------
// End of TVDBSiteMirror.cs
/// -------------------------------------------------------------------------------------------------
